package com.adou.d16.ps;

import java.io.FileNotFoundException;
import java.io.PrintStream;

public class PSTest2 {
    public static void main(String[] args) {
        System.out.println("锄禾日当午");
        System.out.println("汗滴禾下土");
        try(
                final PrintStream ps = new PrintStream("d1-helloword-app\\src\\it10.txt");

        ) {
            System.setOut(ps);

            System.out.println("谁知盘中餐");
            System.out.println("粒粒皆辛苦");

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        // 为啥不输出
        System.out.println("打印结束");

    }
}
